package com.mccken.designpattern.factory.simple_factory.demo1;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2023-04-12 22:51
 **/
public class SimpleFactory {

	public static IProduct createProduct(int type) {
		switch (type) {
			case Const.PRODUCT_A:
				return new ProductA();
			case Const.PRODUCT_B:
				return new ProductB();
			case Const.PRODUCT_C:
				return new ProductC();
			default:
				return null;
		}
	}
}
